package com.javase.Homework;

public class Homework06 {
    public static void main(String[] args) {
        Cale cale = new Cale(1,2);
        System.out.println("和="+cale.he());
    }
}

class Cale{
    double n1;
    double n2;
    public Cale(double n1,double n2){
        this.n1 = n1;
        this.n2 = n2;
    }
    public double he(){
        return n1+n2;
    }
    public double cha(){
        return n1-n2;
    }
    public double cheng(){
        return n1*n2;
    }
    public double chu(){
        if (n2 != 0) {
            return n1 / n2;
        }else {
            System.out.println("0不能为除数");
        }
        return 0;
    }
}